package cn.powertime.evaluation.vo;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author liqi
 * @since 2019-04-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ReqUserAddVo implements Serializable {

    private static final long serialVersionUID = 1L;


    //
    //@Pattern(regexp = "([\\u4e00-\\u9fa5]{2,6})|([A-Za-z]{4,12})", message = "帐号不能为空，必须由4-12个字母或2-6个汉字组成。")
//    @Pattern(regexp = "^[a-zA-Z][0-9a-zA-Z]{3,11}$", message = "帐号不能为空，必须由4-12个字母和数字组成。")
    /**
     * 帐号
     */
    @NotBlank(message = "帐号不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8][0-9]{9}$", message = "手机号不合法")
    private String account;

    @NotNull(message = "短信验证码不能为空")
    private String smsCode;

    @NotNull(message = "密码不能为空")
    private String password;

    @NotNull(message = "重复密码不能为空")
    private String repeatPassword;

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
